﻿@{
    ViewBag.Title = "Home Page";
}
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
            <p>
                To learn more about ASP.NET MVC visit
                <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
                The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET MVC.
                If you have any questions about ASP.NET MVC visit
                <a href="http://forums.asp.net/1146.aspx/1?MVC" title="ASP.NET MVC Forum">our forums</a>.
            </p>
        </div>
    </section>
}
<object id="winFirefoxPlugin" type="application/x-sharepoint" width="0" height="0" style="visibility: hidden;">Test-2.docx</object>
<h3>We suggest the following:</h3>
<ol class="round">
    <li class="one">
        <a onclick='javascript: editDocument();' href='#'>Word Doc</a>
    </li>

    @*    <li class="two">
        <h5>Add NuGet packages and jump-start your coding</h5>
        NuGet makes it easy to install and update free libraries and tools.
        <a href="http://go.microsoft.com/fwlink/?LinkId=245153">Learn more…</a>
    </li>

    <li class="three">
        <h5>Find Web Hosting</h5>
        You can easily find a web hosting company that offers the right mix of features
        and price for your applications.
        <a href="http://go.microsoft.com/fwlink/?LinkId=245157">Learn more…</a>
    </li>*@
</ol>
@section Scripts {
    <script>
        var fNewDoc = false;
        $(document).ready(function () {

            var fNewDoc = false;
            var EditDocumentButton = null;
            try {
                EditDocumentButton = new ActiveXObject('SharePoint.OpenDocuments.2');
                if (EditDocumentButton != null) {
                    fNewDoc = true;
                }
            } catch (e) {
            }
        });

        var L_EditDocumentError_Text = "Editing not supported.";
        var L_EditDocumentRuntimeError_Text = "Sorry, couldn't open the document.";

        function editDocument() {
            if (fNewDoc) {
                if (!EditDocumentButton.EditDocument(strDocument)) {
                    alert(L_EditDocumentRuntimeError_Text);
                }
            } else {
                try {
                    var hownowPlugin = document.getElementById("winFirefoxPlugin");
                    var ss = hownowPlugin.GetOfficeVersion();
                    hownowPlugin.EditDocument('http://localhost:46961/wordstorage/Test-2.docx', ss);
                } catch (e) {
                    alert(L_EditDocumentError_Text);
                }
            }
        }

    </script>
}